Skip to content

Conversation

aditiagarwal34550
Copy link
Member

…≤ i, j ≤ N, which is defined as |array[i] - array[j]| + |i - j|, where |x| denotes absolute value of x.

…≤ i, j ≤ N, which is defined as |array[i] - array[j]| + |i - j|, where |x| denotes absolute value of x.
You are in an infinite 2D grid where you can move in any of the 8 directions :
 (x,y), (x+1, y), (x - 1, y),  (x, y+1), (x, y-1), (x-1, y-1), (x+1,y+1), (x-1,y+1), (x+1,y-1) 
You are given a sequence of points and the order in which you need to cover the points. Give the minimum number of steps in which you can achieve it. You start from the first point.
You are in an infinite 2D grid where you can move in any of the 8 directions :
 (x, y), (x +1, y), (x - 1, y),  (x, y + 1),  (x, y - 1),  (x - 1, y - 1),  (x + 1, y + 1),  (x - 1,y + 1), (x + 1, y - 1) 
You are given a sequence of points and the order in which you need to cover the points. Give the minimum number of steps in which you can achieve it. You start from the first point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant